package fileConfig;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map.Entry;

public class sheetData {
	String sheetTitle;		//sheel名称
	ArrayList<String> shellHeader;		//表头
	ArrayList< HashMap<String,Object>> sheetData;  //表的数据
	
	public sheetData(String sheetTitle,ArrayList<String> shellHeader,ArrayList< HashMap<String,Object>> sheetData) {
		this.sheetTitle=sheetTitle;
		this.shellHeader=shellHeader;
		this.sheetData=sheetData;	
	}
	
	public ArrayList<HashMap<String, Object>> getSheetData() {
		return sheetData;
	}
	
	public ArrayList<String> getShellHeader() {
		return shellHeader;
	}
	
	public String getSheetTitle() {
		return sheetTitle;
	}
	
	public static String toString(sheetData data) {
		StringBuffer sb=new StringBuffer();
		sb.append("sheetTitle="+data.sheetTitle+"\r\n");
		sb.append("shellHeader="+Arrays.toString(data.shellHeader.toArray())+"\r\n");
		for (HashMap<String, Object> row :data.sheetData ) {
			for (Entry<String, Object> rowdata :row.entrySet()) {
				sb.append(rowdata.getKey()+"="+rowdata.getValue()+"   ");
			}
			sb.append("\r\n");
		}
		return sb.toString();
	}
}
